From: Jonas Dreßler Date: Wed, 6 Apr 2022 10:51:45 +0000 (+0200) Subject: Pass events to the OSK in dialogs which grab events X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~480^2^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=66331e124410a9fff1f5fd173e0b771990662bd5;p=gnome-shell.git Pass events to the OSK in dialogs which grab events With commit c29e0cf6e60a1296b43fc33d94f2acc649046cf9 the grabHelper already started using a similar mechanism to funnel events to the osk while a ClutterGrab is in effect. ModalDialog, the unlockDialog and lookingGlass don't make use of the grabHelper though, they use Main.pushModal() themselves, so those need to funnel the events to the OSK themselves. Part-of: --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 1f10b5a8e..7dea38420 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -1421,6 +1421,13 @@ class LookingGlass extends St.BoxLayout { this._resize(); } + vfunc_captured_event(event) { + if (Main.keyboard.maybeHandleEvent(event)) + return Clutter.EVENT_STOP; + + return Clutter.EVENT_PROPAGATE; + } + _updateFont() { let fontName = this._interfaceSettings.get_string('monospace-font-name'); let fontDesc = Pango.FontDescription.from_string(fontName); diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 9d5521be9..04c0cf8ca 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -114,6 +114,13 @@ var ModalDialog = GObject.registerClass({ return Clutter.EVENT_PROPAGATE; } + vfunc_captured_event(event) { + if (Main.keyboard.maybeHandleEvent(event)) + return Clutter.EVENT_STOP; + + return Clutter.EVENT_PROPAGATE; + } + clearButtons() { this.dialogLayout.clearButtons(); } diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 866513c46..dd13e312b 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -625,6 +625,13 @@ var UnlockDialog = GObject.registerClass({ return Clutter.EVENT_PROPAGATE; } + vfunc_captured_event(event) { + if (Main.keyboard.maybeHandleEvent(event)) + return Clutter.EVENT_STOP; + + return Clutter.EVENT_PROPAGATE; + } + _createBackground(monitorIndex) { let monitor = Main.layoutManager.monitors[monitorIndex]; let widget = new St.Widget({